package cn.roadtrip.mtravelbusinessmodule.mvc.active;

import cn.roadtrip.mtravelbusinessmodule.bs.active.TravelActiveImpl;
import cn.roadtrip.utilmodule.util.DataBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/active")
@Slf4j
public class ActiveController {
    @Autowired
    private TravelActiveImpl travelActiveImpl;


    /**
     * 创建旅游活动
     * @param model
     * @return
     */
    @PostMapping("/createTravelActive")
    public DataBean createTravelActive(
            @RequestBody TravelActiveImpl.Model_createTravelActive model){
        return travelActiveImpl.createTravelActive(model);
    }

    /**
     * 解除活动条目绑定
     * @param model
     * @return
     */
    @PostMapping("/unbindTravelActive")
    public DataBean unbindTravelActive(@RequestBody TravelActiveImpl.Model_unbindTravelActive model){
        return travelActiveImpl.unbindTravelActive(model);
    }

    /**
     * 修改活动信息
     * @param model
     * @return
     */
    @PostMapping("/updateTravelActiveInfor")
    public DataBean updateTravelActiveInfor(@RequestBody TravelActiveImpl.Model_updateTravelActiveInfor model){
        return travelActiveImpl.updateTravelActiveInfor(model);
    }


    /**
     * 查询活动列表
     * @param model
     * @return
     */
    @PostMapping("/getTravelActiveList")
    public DataBean getTravelActiveList(@RequestBody TravelActiveImpl.Model_getTravelActiveList model){
        return travelActiveImpl.getTravelActiveList(model);
    }
}
